package com.green.dao.manage.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.green.common.page.Pagination;
import com.green.dao.impl.BaseDaoImpl;
import com.green.dao.manage.JoinPackageDao;
import com.green.model.manage.JoinPackage;



/**
 * 加盟套餐
 * 
 */
@Repository("joinPackageDao")
public class JoinPackageDaoImpl extends BaseDaoImpl implements JoinPackageDao {

	@Override
	public int insertJoinPackage(JoinPackage ct) {
		return insert("com.green.dao.manage.JoinPackageDao.insertJoinPackage", ct);
	}

	@Override
	public int updateJoinPackage(JoinPackage ct) {
		return update("com.green.dao.manage.JoinPackageDao.updateJoinPackage", ct);
	}

	@Override
	public int deleteJoinPackage(Map<String, Object> param) {
		return delete("com.green.dao.manage.JoinPackageDao.deleteJoinPackage", param);
	}

	@Override
	public JoinPackage getJoinPackageById(String id) {
		return (JoinPackage) super.getSqlSession().selectOne("com.green.dao.manage.JoinPackageDao.getJoinPackageById",id);	
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<JoinPackage> getJoinPackageList(Map<String, Object> param) {
		return (List<JoinPackage>) selectList("com.green.dao.manage.JoinPackageDao.getJoinPackageList", param);
	}

	@Override
	public Pagination<JoinPackage> getJoinPackagePagination(
			Pagination<JoinPackage> pag, Map<String, Object> param) {
		return selectList("com.green.dao.manage.JoinPackageDao.getJoinPackageList", param, pag);
	}
	
	
}
